<extend name="./public/frame.html"/>
<block name="content">
    <div class="ncap-form-default">
        <form class="layui-form" method="post" action="" name="admin_form">
            <input type="hidden" name="admin_id" value="{$admin_id}">
            <table class="layui-table" style="width: 30%">
                <eq name="init" value="1">
                    <caption style="font-size: large;font-weight: bold">请先修改初始密码</caption>
                </eq>
                <tr>
                    <td style="text-align: right">原密码</td>
                    <td><input id="old_pw" name="old_pw" class="layui-input" lay-verify="required" type="password" placeholder="请填写原密码"></td>
                </tr>
                <tr>
                    <td style="text-align: right">新密码</td>
                    <td><input id="new_pw" name="new_pw" class="layui-input" lay-verify="pass" type="password" placeholder="密码必须6到12位，且不能出现空格"></td>
                </tr>
                <tr>
                    <td style="text-align: right">确认密码</td>
                    <td><input id="new_pw2" name="new_pw2" class="layui-input" lay-verify="pass|newPass" type="password" placeholder="密码必须6到12位，且不能出现空格"></td>
                </tr>
            </table>
            <button class="layui-btn" lay-submit="" lay-filter="submit">提交</button>
        </form>
    </div>
    <script type="text/javascript">
        layui.use(['form', 'upload'], function(){
            var form = layui.form
                ,layer = layui.layer;
            form.verify({
                pass: [
                    /^[\S]{6,12}$/
                    ,'密码必须6到12位，且不能出现空格'
                ]
                ,newPass:function (value,item) {
                    if(value != $('#new_pw').val()){
                        return "与新密码不一致";
                    }
                }
            });
            //监听提交
            form.on('submit(submit)', function(data){
            });
        });
    </script>
</block>
